package com.zdy.im.tio.packets;

import com.sixeco.framework.common.api.ApiDesc;
import com.sixeco.framework.common.data.BaseBeanClone;
import com.sixeco.framework.util.json.JsonUtils;
import com.zdy.im.tio.command.Command;

/**
 * @Author 作者 : zdy
 * @CreateDate 创建时间: 2021-02-30
 * @Version 版本: v1.0.0
 * <pre>
 *
 *  @Description (说明):  读消息协议请求对象
 *
 * </pre>
 **/

public class ChatReadStatusRequestVo extends BaseBeanClone {

//    @ApiDesc(value = "变更消息状态协议编码cmd=105",required = 1)
    private int cmd;
    @ApiDesc(value = "发送者用户id",required = 1)
    private long sendUserId;
    @ApiDesc(value = "用接者用户id",required = 1)
    private long toUserId;
    @ApiDesc(value = "变更消息Id",required = 1)
    private long messageId;
    @ApiDesc(value = "消息唯一值id,使用雪花算法生成唯一id;用于排序和搜索使用", required = 0)
    private long globalId;
    /** ChatMessageEnum 数据来源于这个枚举**/
    @ApiDesc(value = "变更消息类型,0.未读,1.已读,2.撤销,3.删除")
    private int messageType;

    public static ChatReadStatusRequestVo build() {
       return new ChatReadStatusRequestVo();
    }

    public long getGlobalId() {
        return globalId;
    }

    public void setGlobalId(long globalId) {
        this.globalId = globalId;
    }

    public ChatReadStatusRequestVo toSendUserId(long sendUserId) {
        this.sendUserId = sendUserId;
        return this;
    }

    public ChatReadStatusRequestVo toToUserId(long toUserId) {
        this.toUserId = toUserId;
        return this;
    }

    public ChatReadStatusRequestVo toMessageId(long messageId) {
        this.messageId = messageId;
        return this;
    }

    public ChatReadStatusRequestVo toCmd(int cmd) {
        this.cmd = cmd;
        return this;
    }

    public ChatReadStatusRequestVo toMessageType(int messageType) {
        this.messageType = messageType;
        return this;
    }

    public long getSendUserId() {
        return sendUserId;
    }

    public void setSendUserId(long sendUserId) {
        this.sendUserId = sendUserId;
    }

    public long getToUserId() {
        return toUserId;
    }

    public void setToUserId(long toUserId) {
        this.toUserId = toUserId;
    }

    public long getMessageId() {
        return messageId;
    }

    public void setMessageId(long messageId) {
        this.messageId = messageId;
    }

    public int getCmd() {
        return cmd;
    }

    public void setCmd(int cmd) {
        this.cmd = cmd;
    }

    public int getMessageType() {
        return messageType;
    }

    public void setMessageType(int messageType) {
        this.messageType = messageType;
    }

    public static void main(String[] args) {
        ChatReadStatusRequestVo vo = ChatReadStatusRequestVo.build();
        vo.setCmd(Command.COMMAND_CHAT_STATUS_REQ.getNumber());
        vo.setSendUserId(12);
        vo.setToUserId(34);
        vo.setMessageId(123456);
        System.out.println(JsonUtils.toJson(vo));
    }
}
